<template>
	<view class="page-content">
		<view class="n_title">{{title}}</view>
		<view class="content-content">
			<view class="d-pannel u-info">
				<view class="uni-row">
					<view class="u-icon">
						<image src="/static/login.png"></image>
					</view>
					<view class="user-text">
						<view>{{user.name}}</view>
						<view>{{user.phone}}</view>
					</view>
				</view>
				<view class="u-dr">
					<view class="uni-row">
						<view>部门：</view>
						<view class="uni-row">
							<view v-for="(d,dix) in user.dptList" :key="'d'+dix">{{d}}</view>
						</view>
					</view>
					<view class="uni-row">
						<view>角色：</view>
						<view class="uni-row">
							<view v-for="(d,dix) in user.roleList"  :key="'r'+dix">{{d}}</view>
						</view>
					</view>
					
				</view>
				
				
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'我的',
				user:{
					username:'',
					name:'',
					phone:'',
					roleList:[],
					dptList:[],
				}
			}
		},
		onShow(){
			this.init()
		},
		onLoad() {
			
		},
		methods: {
			init(){
				this.getData()
			},
			getData(){
				let url='/api/user/info'
				this.common.get(url,null,(res)=>{
					if(res.code!=1){
						this.$fun.showError(res.msg)
						return
					}
					this.user = res.data
				})
			},
		}
	}
</script>

<style>
	.u-info{
		padding-left: 30px;
	}
	.u-icon{
		height: 65px;
		width: 65px;
	}
	.u-icon image{
		border-radius: 50%;
		height: 100%;
		width: 100%;
	}
	.user-text{
		margin-left: 60px;
	}
	.user-text > view{
		margin-top: 5px;
	}
	.u-dr{
		margin-top: 10px;
		color: #c5cad2;
		padding-left: 20px;
	}
	.u-dr>view{
		margin-top: 10px;
	}
</style>
